import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex);
// export default
export default new vuex.Store({
  state: {
    fun:[],
    username:'',
    user:{},
    select:0,
    tableData:[
  {
    status:'waiting',
    branch:'1',
    sender:'Jack Simon',
    time:'2018-5-5',
    price:'$120.99',
    user:'10001',
    material:'iron,water',
    burdening:'zin,HCl'
  },{
    status:'waiting',
    branch:'2',
    sender:'Ocean Tick',
    time:'2018-5-5',
    price:'$20.99',
    user:'10229',
    material:'iron',
    burdening:'null'
  },{
    status:'waiting',
    branch:'3',
    sender:'Aimer Truth',
    time:'2018-5-5',
    price:'$10.99',
    user:'10302',
    material:'MicorPhone',
    burdening:'null'
  },{
    status:'waiting',
    branch:'3',
    sender:'Ice Cream',
    time:'2018-5-4',
    price:'$4.99',
    user:'10027',
    material:'tea',
    burdening:'water'
  },{
    status:'warning',
    branch:'1',
    sender:'Jack Simon',
    time:'2018-5-1',
    price:'$0.99',
    user:'10123',
    material:'water',
    burdening:'null'
  },{
    status:'warning',
    branch:'2',
    sender:'Tim Lier',
    time:'2018-4-30',
    price:'$9.99',
    user:'10379',
    material:'wood',
    burdening:'null'
  },{
    status:'success',
    branch:'4',
    sender:'Jobs Simith',
    time:'2018-1-12',
    price:'$2.99',
    user:'10019',
    material:'pastic',
    burdening:'null'
  },{
    status:'success',
    branch:'1',
    sender:'Mary Clear',
    time:'2018-1-1',
    price:'$7.99',
    user:'10120',
    material:'pastic',
    burdening:'null'
  },{
    status:'success',
    branch:'4',
    sender:'Lucy Chain',
    time:'2017-12-24',
    price:'$299.99',
    user:'10200',
    material:'wood',
    burdening:'paper'
  },
    ],
    totalList:[],
    branchList:[],
    branchSelect:'total',
    loginmode:'signin',
    branch:0
  },
  mutations: {
    setFun(state,fun){
      this.state.fun=fun;
    },
    setBranch(state,branch){
      this.state.branch=branch;
    },
    setUsername(state,name){
      this.state.username=name;
    },
    setSel(state,sel){
      this.state.select=sel;
    },
    setTableData(state,table){
      this.state.tableData=table;
    },
    setTotalList(state,list){
      this.state.totalList=list;
    },
    setBranchList(state,list){
      this.state.branchList=list;
    },
    setBranchSelect(state,name){
      this.state.branchSelect=name;
    },
    setLoginMode(state,mode){
      this.state.loginmode=mode;
    },
    setUser(state,user){
      this.state.user=user;
    }
  }
})
